package com.xjoyt.pay.master.controllers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.interfaces.MerchantChannelContract;
import com.xjoyt.pay.master.params.MerchantChannelPageParam;
import com.xjoyt.pay.master.po.MerchantChannel;
import com.xjoyt.pay.master.services.MerchantChannelService;
import com.xjoyt.pay.master.vo.MerchantChannelMap;

@RestController
@RequestMapping("merchantChannel")
public class MerchantChannelController extends AbstractController implements MerchantChannelContract {

	@Autowired
	private MerchantChannelService service;

	@Override
	public PageResult<MerchantChannelMap> loadPage(@RequestBody PageParam<MerchantChannelPageParam> param) {
		return service.loadPage(param);
	}

	@Override
	public ExecuteResult<?> save(@RequestBody MerchantChannelMap param) {
		return service.save(param);
	}

	@Override
	public ExecuteResult<?> remove(@PathVariable("id") String id) {
		return service.delete(id);
	}

	@Override
	public ExecuteResult<?> saveAuto(@RequestBody MerchantChannelMap param) {
		return service.saveAuto(param);
	}

	@RequestMapping("findAll")
	public List<MerchantChannel> finAll() {
		return service.findAll();
	}

}
